package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallGoodsRent;
import com.appkubes.mall.core.po.MallGoodsRentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallGoodsRentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsRentSqlProvider.class, method="countByExample")
    long countByExample(MallGoodsRentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallGoodsRentSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallGoodsRentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_goods_rent",
        "where goods_key = #{goodsKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String goodsKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_goods_rent (goods_key, app_key, ",
        "rent_interest_rate, periods, ",
        "period_type, buy_out_amount, ",
        "rent_money, cost_per_period, ",
        "commision_rate, version)",
        "values (#{goodsKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{rentInterestRate,jdbcType=DECIMAL}, #{periods,jdbcType=INTEGER}, ",
        "#{periodType,jdbcType=TINYINT}, #{buyOutAmount,jdbcType=DECIMAL}, ",
        "#{rentMoney,jdbcType=DECIMAL}, #{costPerPeriod,jdbcType=DECIMAL}, ",
        "#{commisionRate,jdbcType=DECIMAL}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallGoodsRent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallGoodsRentSqlProvider.class, method="insertSelective")
    int insertSelective(MallGoodsRent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsRentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="rent_interest_rate", property="rentInterestRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="periods", property="periods", jdbcType=JdbcType.INTEGER),
        @Result(column="period_type", property="periodType", jdbcType=JdbcType.TINYINT),
        @Result(column="buy_out_amount", property="buyOutAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="rent_money", property="rentMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="cost_per_period", property="costPerPeriod", jdbcType=JdbcType.DECIMAL),
        @Result(column="commision_rate", property="commisionRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallGoodsRent> selectByExampleWithRowbounds(MallGoodsRentExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsRentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="rent_interest_rate", property="rentInterestRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="periods", property="periods", jdbcType=JdbcType.INTEGER),
        @Result(column="period_type", property="periodType", jdbcType=JdbcType.TINYINT),
        @Result(column="buy_out_amount", property="buyOutAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="rent_money", property="rentMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="cost_per_period", property="costPerPeriod", jdbcType=JdbcType.DECIMAL),
        @Result(column="commision_rate", property="commisionRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallGoodsRent> selectByExample(MallGoodsRentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "goods_key, app_key, rent_interest_rate, periods, period_type, buy_out_amount, ",
        "rent_money, cost_per_period, commision_rate, version",
        "from mall_goods_rent",
        "where goods_key = #{goodsKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="goods_key", property="goodsKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="rent_interest_rate", property="rentInterestRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="periods", property="periods", jdbcType=JdbcType.INTEGER),
        @Result(column="period_type", property="periodType", jdbcType=JdbcType.TINYINT),
        @Result(column="buy_out_amount", property="buyOutAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="rent_money", property="rentMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="cost_per_period", property="costPerPeriod", jdbcType=JdbcType.DECIMAL),
        @Result(column="commision_rate", property="commisionRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallGoodsRent selectByPrimaryKey(String goodsKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsRentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallGoodsRent record, @Param("example") MallGoodsRentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsRentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallGoodsRent record, @Param("example") MallGoodsRentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsRentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallGoodsRent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_rent
     *
     * @mbg.generated
     */
    @Update({
        "update mall_goods_rent",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "rent_interest_rate = #{rentInterestRate,jdbcType=DECIMAL},",
          "periods = #{periods,jdbcType=INTEGER},",
          "period_type = #{periodType,jdbcType=TINYINT},",
          "buy_out_amount = #{buyOutAmount,jdbcType=DECIMAL},",
          "rent_money = #{rentMoney,jdbcType=DECIMAL},",
          "cost_per_period = #{costPerPeriod,jdbcType=DECIMAL},",
          "commision_rate = #{commisionRate,jdbcType=DECIMAL},",
          "version = #{version,jdbcType=INTEGER}",
        "where goods_key = #{goodsKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallGoodsRent record);
}